Repository navigation
Make XsltStepTest DOCTYPE check locale-independent - #482
tonygermano merged 1 commit into
Conversation
…gine#476) The JDK translates the "DOCTYPE is disallowed" message, so the test failed on non-English locales. Check the feature URI instead, which appears in every translation. Signed-off-by: Ezio Caffi <ezio.caffi@gmail.com>
|
Could you also require the parse error itself? For example: String s = String.valueOf(e);
assertTrue(s, s.contains("SAXParseException") && s.contains("disallow-doctype-decl")); |
@NicoPiel This is the stack trace (in French). The actual exception is a |
tonygermano
left a comment
There was a problem hiding this comment.
Thanks! I appreciate someone running the builds in other locales and submitting fixes.
Maybe we'll have actual i18n support at some point 😄
pacmano1
left a comment
There was a problem hiding this comment.
Heads up for anyone repeating this: switching locale between runs doesn't re-run the tests. Gradle doesn't count the locale as a test input, so :server:test comes back UP-TO-DATE and BUILD SUCCESSFUL without running anything. Add --rerun:
./gradlew -Duser.language=it -Duser.country=IT :server:test --tests '*XsltStepTest' --rerun
|
@tonygermano I agree, but the additional work required is negligible. Still, gonna approve. |
The JDK kindly translates "DOCTYPE is disallowed", so on an Italian machine the test got "DOCTYPE non è consentito" and gave up. Now it checks for
disallow-doctype-decl, the feature URI that every translation keeps as is. No locale forcing needed.Passes on it, tr, en and ja.
Part of #476 (the CI scenario is still to come)